﻿@model IEnumerable<CallCenter.Data.Models.MenuVM>


<table class="table-fill">
    <thead>
        <tr>
            <th class="text-left">Menu </th>
            <th class="text-left">Status </th>
        </tr>
    </thead>
    @foreach (var item in Model.Where(m => m.ParentID == 0))
    {
        <tr>
            <th class="text-left">@item.Menu</th>
            <th class="text-left"></th>
        </tr>
        foreach (var child in Model.Where(m => m.ParentID == @item.MenuID))
        {
        <tr>
            <td class="text-left">@child.Menu</td>
            <td class="text-left">
                @if (child.Active)
                {
                    <img id=@child.MenuID src="~/Content/True.png" style="cursor:pointer" onclick="ChangeStatus(@child.RoleID, @child.MenuID,'False')" />@*
                    <input type="checkbox" name="name" value="" checked="checked" onclick="ChangeStatus(@child.RoleID, @child.MenuID,'False')" />*@
                }
                else
                {<img id=@child.MenuID src="~/Content/False.png"  style="cursor:pointer" onclick="ChangeStatus(@child.RoleID, @child.MenuID, 'True')"/>
@*<input type="checkbox" name="name" value="" onclick="ChangeStatus(@child.RoleID, @child.MenuID, 'True')" />*@
                }
            </td>
        </tr>
        }
    }
</table>


